//
//  GTNewfeatureLayout.m
//  GiftTalk
//
//  Created by Wan on 16/4/19.
//  Copyright © 2016年 Wan. All rights reserved.
//

#import "GTNewfeatureLayout.h"

@interface GTNewfeatureLayout ()
/** 自定义布局 */
@property (strong, nonatomic) UICollectionViewFlowLayout *flowLayout;

@end

@implementation GTNewfeatureLayout

- (UICollectionViewFlowLayout *)flowLayout {
    if (!_flowLayout) {
        _flowLayout = [[UICollectionViewFlowLayout alloc] init];
    }
    return _flowLayout;
}

// 准备布局
// 什么时候调用？1. 先调用一共有多少行cell 2.调用准备布局 3. 调用返回 cell
- (void)prepareLayout {
    //1. 设置 layout 布局
    self.flowLayout.itemSize = GTScreenBounds.size;
    self.flowLayout.minimumInteritemSpacing = 0;
    self.flowLayout.minimumLineSpacing = 0;
    
    //2.设置滚动方向为水平
    self.flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
    
    //3.设置 collectionView 的属性
//    self.flowLayout.collectionView.showsHorizontalScrollIndicator = NO;
//    self.flowLayout.collectionView.bounces = NO;
//    self.flowLayout.collectionView.pagingEnabled = YES;
    
}

@end
